package com.cyt.work.divideclass.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 智能分班分班设置-智能分班分班设置实体类
 *
 * @author caideyong
 * @date 2019-12-20 14:11:03
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_divideclass_class")
public class DivideclassClass implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 班级名称
     */
    @Column(name = "NAME")
    @Excel(name = "班级", orderNum = "1")
    private String name;

    /**
     * 班级人数
     */
    @Column(name = "NUM")
    @Excel(name = "总人数", orderNum = "2")
    private String num;

    /**
     * 班主任
     */
    @Column(name = "HEAD_TEACHER")
    private String headTeacher;

    @Transient
    private String headTeacherName;

    /**
     * 分班设置id
     */
    @Column(name = "RULE_ID")
    private String ruleId;

    /**
     * 创建时间
     */
    @Column(name = "CREATE_TIME")
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "CREATOR")
    private String creator;

    /**
     * 删除标志
     */
    @Column(name = "REMOVE_TAG")
    private String removeTag;

    /**
     * 男生人数
     */
    @Column(name = "B_NUM")
    @Excel(name = "男生人数", orderNum = "3")
    private String bnum;

    /**
     * 女生人数
     */
    @Column(name = "G_NUM")
    @Excel(name = "女生人数", orderNum = "4")
    private String gnum;

    /**
     * 总均分
     */
    @Column(name = "AVERAGE")
    @Excel(name = "总均分", orderNum = "5")
    private String average;

    /**
     * 分班id
     */
    @Column(name = "DIVIDE_ID")
    private String divideId;

    @Column(name = "PARENT_ID")
    private String parentId;

    @Transient
    private String parentName;
    /**
     * 创建对象
     *
     * @param sysUser 当前用户信息
     * @author caideyong
     * @date 2019-12-20 14:11:03
     */
    public DivideclassClass(SysUser sysUser) {
        this.id = BaseUtil.uId();
        this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.creator = sysUser.getId();
    }
}